package day5;

import java.util.Scanner;

public class TestMenu {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Menu menu = new Menu();
        while (true) {
            StartSMS sms = new StartSMS();
            menu.welcome();
            System.out.print("请选择,输入数字:");
            int choose = input.nextInt();
//           if(输入不合法)... sout(输入不合法) continue;
            if (choose == 2) break;
            System.out.print("请输入用户名:");
            sms.username = input.next();
            System.out.print("请输入密码:");
            sms.password = input.next();
            // 判断是否登录成功
            if(!sms.login()) {
                System.out.println("您没有权限进入系统,请重新登录.");
                continue;
            }
            // 执行到这,代表登录成功
            menu.mainMenu();
            System.out.print("请选择:");
            int mainChoose = input.nextInt();
        }

        System.out.println("系统退出!");
    }
}
